﻿using Services.Equ.PcapCommunication.Abstract;
using SharpPcap;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;

namespace Services.Equ.PcapCommunication
{
    /// <summary>
    /// 升级boot
    /// </summary>
    public class UpgradeBootCommunicaition : AbstractNormalCommunication
    {
        public UpgradeBootCommunicaition(PhysicalAddress destinationMac, string password, ILiveDevice device) : base(destinationMac, password, device)
        {
            WaitMillisecond = 5000;
            ReciveBreak = 100;
            RpcType = 1;
            OptionType = 5;
            OpType = 5;
            DcpType = 0x50009;
        }

        public override byte[] CreateBlockData()
        {
            return [];
        }
        public override bool IsResponse(byte[] bytes)
        {
            if (bytes.Length >= 108)
            {
                return base.IsResponse(bytes);
            }
            else
            {
                return false;
            }   
        }
        public override bool ConvertData2Result(byte[] bytes)
        {
            return base.ConvertData2Result(bytes);
        }
        public override Task<List<bool>> GetCommunicationResult()
        {
            return base.GetCommunicationResult();
        }
    }
}
